package com.pascuit.gpxhandler.shared.parser;

import com.sun.xml.bind.marshaller.NamespacePrefixMapper;

/**
 * 
 * @author Parant
 * 
 */
public class GpxNamespacePrefixMapper extends NamespacePrefixMapper {

	private static final String EMPTY_STRING = "";
	public static String URI_GPX = "http://www.topografix.com/GPX/1/1";
	public static String URI_EXTENSION = "http://www.garmin.com/xmlschemas/TrackPointExtension/v1";

	public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
		if (URI_GPX.equals(namespaceUri)) {
			return EMPTY_STRING;
		} else if (URI_EXTENSION.equals(namespaceUri)) {
			return "gpxtpx";
		}
		return suggestion;
	}
}
